home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / DriverServices.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  21.3 KB  |  840 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        DriverServices.a
  3. ;
  4. ;    Contains:    Driver Services Interfaces.
  5. ;
  6. ;    Version:    Technology:    PowerSurge 1.0.2
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__DRIVERSERVICES__') = 'UNDEFINED' THEN
  19. __DRIVERSERVICES__ SET 1
  20.  
  21.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  22.     include 'ConditionalMacros.a'
  23.     ENDIF
  24.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  25.     include 'MacTypes.a'
  26.     ENDIF
  27.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  28.     include 'Errors.a'
  29.     ENDIF
  30.     IF &TYPE('__MACHINEEXCEPTIONS__') = 'UNDEFINED' THEN
  31.     include 'MachineExceptions.a'
  32.     ENDIF
  33.     IF &TYPE('__DEVICES__') = 'UNDEFINED' THEN
  34.     include 'Devices.a'
  35.     ENDIF
  36.     IF &TYPE('__DRIVERSYNCHRONIZATION__') = 'UNDEFINED' THEN
  37.     include 'DriverSynchronization.a'
  38.     ENDIF
  39.  
  40. ; ******************************************************************
  41. ; *
  42. ; *         Previously in Kernel.h
  43. ; *
  44. ; *****************************************************************
  45.  
  46. ;  Kernel basics
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55. ;  OrderedItem stuff
  56. ; typedef OSType                         OrderedItemService
  57.  
  58. ; typedef OSType                         OrderedItemSignature
  59.  
  60.  
  61. kMatchAnyOrderedItemService        EQU        '****'
  62. kMatchAnyOrderedItemSignature    EQU        '****'
  63. kDoNotMatchAnyOrderedItemService EQU    '----'
  64. kDoNotMatchAnyOrderedItemSignature EQU    '----'
  65. OrderedItemName            RECORD 0
  66. service                     ds.l    1                ; offset: $0 (0)
  67. signature                 ds.l    1                ; offset: $4 (4)
  68. sizeof                     EQU *                    ; size:   $8 (8)
  69.                         ENDR
  70. ; typedef struct OrderedItemName *        OrderedItemNamePtr
  71.  
  72. ; typedef OptionBits                     OrderedItemOptions
  73.  
  74.  
  75. kOrderedItemIsRightBefore        EQU        $00000001
  76. kOrderedItemIsRightAfter        EQU        $00000002
  77. OrderRequirements        RECORD 0
  78. options                     ds.l    1                ; offset: $0 (0)
  79. itemBefore                 ds        OrderedItemName ; offset: $4 (4)
  80. itemAfter                 ds        OrderedItemName ; offset: $C (12)
  81. sizeof                     EQU *                    ; size:   $14 (20)
  82.                         ENDR
  83. ; typedef struct OrderRequirements *    OrderRequirementsPtr
  84.  
  85. ;  Tasking
  86. ; typedef UInt32                         ExecutionLevel
  87.  
  88.  
  89. kTaskLevel                        EQU        0
  90. kSoftwareInterruptLevel            EQU        1
  91. kAcceptFunctionLevel            EQU        2
  92. kKernelLevel                    EQU        3
  93. kSIHAcceptFunctionLevel            EQU        4
  94. kSecondaryInterruptLevel        EQU        5
  95. kHardwareInterruptLevel            EQU        6
  96.  
  97. kCurrentAddressSpaceID            EQU        -1
  98.  
  99. ;  Memory System basics
  100. LogicalAddressRange        RECORD 0
  101. address                     ds.l    1                ; offset: $0 (0)
  102. count                     ds.l    1                ; offset: $4 (4)
  103. sizeof                     EQU *                    ; size:   $8 (8)
  104.                         ENDR
  105. ; typedef struct LogicalAddressRange *    LogicalAddressRangePtr
  106.  
  107. PhysicalAddressRange    RECORD 0
  108. address                     ds.l    1                ; offset: $0 (0)
  109. count                     ds.l    1                ; offset: $4 (4)
  110. sizeof                     EQU *                    ; size:   $8 (8)
  111.                         ENDR
  112. ; typedef struct PhysicalAddressRange *    PhysicalAddressRangePtr
  113.  
  114. ;  For PrepareMemoryForIO and CheckpointIO
  115. ; typedef OptionBits                     IOPreparationOptions
  116.  
  117.  
  118. kIOMultipleRanges                EQU        $00000001
  119. kIOLogicalRanges                EQU        $00000002
  120. kIOMinimalLogicalMapping        EQU        $00000004
  121. kIOShareMappingTables            EQU        $00000008
  122. kIOIsInput                        EQU        $00000010
  123. kIOIsOutput                        EQU        $00000020
  124. kIOCoherentDataPath                EQU        $00000040
  125. kIOTransferIsLogical            EQU        $00000080
  126. kIOClientIsUserMode                EQU        $00000080
  127. ; typedef OptionBits                     IOPreparationState
  128.  
  129.  
  130. kIOStateDone                    EQU        $00000001
  131.  
  132. kInvalidPageAddress                EQU        -1
  133. AddressRange            RECORD 0
  134. base                     ds.l    1                ; offset: $0 (0)
  135. length                     ds.l    1                ; offset: $4 (4)
  136. sizeof                     EQU *                    ; size:   $8 (8)
  137.                         ENDR
  138. ;  C's treatment of arrays and array pointers is atypical
  139. LogicalMappingTable        RECORD 0
  140. elements                 ds.l    1
  141. sizeof                     EQU *                    ; size:   $4 (4)
  142.                         ENDR
  143.  
  144.  
  145. ; typedef LogicalMappingTable *            LogicalMappingTablePtr
  146.  
  147. PhysicalMappingTable    RECORD 0
  148. elements                 ds.l    1
  149. sizeof                     EQU *                    ; size:   $4 (4)
  150.                         ENDR
  151.  
  152.  
  153. ; typedef PhysicalMappingTable *        PhysicalMappingTablePtr
  154.  
  155. AddressRangeTable        RECORD 0
  156. elements                 ds.b    1 * AddressRange.sizeof
  157. sizeof                     EQU *                    ; size:   $8 (8)
  158.                         ENDR
  159.  
  160.  
  161. ; typedef AddressRangeTable *            AddressRangeTablePtr
  162.  
  163. MultipleAddressRange    RECORD 0
  164. entryCount                 ds.l    1                ; offset: $0 (0)
  165. rangeTable                 ds.l    1                ; offset: $4 (4)
  166. sizeof                     EQU *                    ; size:   $8 (8)
  167.                         ENDR
  168.  
  169. ;   Separate C definition so that union has a name.  A future version of the interfacer
  170. ;   tool will allow a name (that gets thrown out in Pascal and Asm).
  171.  
  172.  
  173. IOPreparationTable        RECORD 0
  174. options                     ds.l    1                ; offset: $0 (0)
  175. state                     ds.l    1                ; offset: $4 (4)
  176. preparationID             ds.l    1                ; offset: $8 (8)
  177. addressSpace             ds.l    1                ; offset: $C (12)
  178. granularity                 ds.l    1                ; offset: $10 (16)
  179. firstPrepared             ds.l    1                ; offset: $14 (20)
  180. lengthPrepared             ds.l    1                ; offset: $18 (24)
  181. mappingEntryCount         ds.l    1                ; offset: $1C (28)
  182. logicalMapping             ds.l    1                ; offset: $20 (32)
  183. physicalMapping             ds.l    1                ; offset: $24 (36)
  184. range                     ds        AddressRange    ; offset: $28 (40)
  185.                          ORG 40
  186. multipleRanges             ds        MultipleAddressRange ; offset: $28 (40)
  187. sizeof                     EQU *                    ; size:   $30 (48)
  188.                         ENDR
  189. ; typedef OptionBits                     IOCheckpointOptions
  190.  
  191.  
  192. kNextIOIsInput                    EQU        $00000001
  193. kNextIOIsOutput                    EQU        $00000002
  194. kMoreIOTransfers                EQU        $00000004
  195. ;  For SetProcessorCacheMode
  196.  
  197. ; typedef UInt32                         ProcessorCacheMode
  198.  
  199.  
  200. kProcessorCacheModeDefault        EQU        0
  201. kProcessorCacheModeInhibited    EQU        1
  202. kProcessorCacheModeWriteThrough    EQU        2
  203. kProcessorCacheModeCopyBack        EQU        3
  204. ;  For GetPageInformation
  205.  
  206.  
  207. kPageInformationVersion            EQU        1
  208. ; typedef UInt32                         PageStateInformation
  209.  
  210.  
  211. kPageIsProtected                EQU        $00000001
  212. kPageIsProtectedPrivileged        EQU        $00000002
  213. kPageIsModified                    EQU        $00000004
  214. kPageIsReferenced                EQU        $00000008
  215. kPageIsLockedResident            EQU        $00000010
  216. kPageIsInMemory                    EQU        $00000020
  217. kPageIsShared                    EQU        $00000040
  218. kPageIsWriteThroughCached        EQU        $00000080
  219. kPageIsCopyBackCached            EQU        $00000100
  220. kPageIsLocked                    EQU        $00000010            ; Deprecated
  221. kPageIsResident                    EQU        $00000020            ; Deprecated
  222. PageInformation            RECORD 0
  223. area                     ds.l    1                ; offset: $0 (0)
  224. count                     ds.l    1                ; offset: $4 (4)
  225. information                 ds.l    1                ; offset: $8 (8) <-- really an array of length one
  226. sizeof                     EQU *                    ; size:   $C (12)
  227.                         ENDR
  228. ; typedef struct PageInformation *        PageInformationPtr
  229.  
  230.  
  231. ;   Tasks  
  232. ;
  233. ; extern ExecutionLevel CurrentExecutionLevel(void )
  234. ;
  235.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  236.         IMPORT_CFM_FUNCTION CurrentExecutionLevel
  237.     ENDIF
  238.  
  239. ;
  240. ; extern TaskID CurrentTaskID(void )
  241. ;
  242.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  243.         IMPORT_CFM_FUNCTION CurrentTaskID
  244.     ENDIF
  245.  
  246. ;
  247. ; extern OSStatus DelayFor(Duration delayDuration)
  248. ;
  249.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  250.         IMPORT_CFM_FUNCTION DelayFor
  251.     ENDIF
  252.  
  253. ;
  254. ; extern Boolean InPrivilegedMode(void )
  255. ;
  256.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  257.         IMPORT_CFM_FUNCTION InPrivilegedMode
  258.     ENDIF
  259.  
  260.  
  261. ;   Software Interrupts  
  262. ;
  263. ; extern OSStatus CreateSoftwareInterrupt(SoftwareInterruptHandler handler, TaskID task, void *p1, Boolean persistent, SoftwareInterruptID *theSoftwareInterrupt)
  264. ;
  265.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  266.         IMPORT_CFM_FUNCTION CreateSoftwareInterrupt
  267.     ENDIF
  268.  
  269.  
  270. ;
  271. ; extern OSStatus SendSoftwareInterrupt(SoftwareInterruptID theSoftwareInterrupt, void *p2)
  272. ;
  273.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  274.         IMPORT_CFM_FUNCTION SendSoftwareInterrupt
  275.     ENDIF
  276.  
  277. ;
  278. ; extern OSStatus DeleteSoftwareInterrupt(SoftwareInterruptID theSoftwareInterrupt)
  279. ;
  280.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  281.         IMPORT_CFM_FUNCTION DeleteSoftwareInterrupt
  282.     ENDIF
  283.  
  284.     IF TARGET_OS_MAC THEN
  285. ;   Secondary Interrupts  
  286. ;
  287. ; extern OSStatus CallSecondaryInterruptHandler2(SecondaryInterruptHandler2 theHandler, ExceptionHandler exceptionHandler, void *p1, void *p2)
  288. ;
  289.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  290.         IMPORT_CFM_FUNCTION CallSecondaryInterruptHandler2
  291.     ENDIF
  292.  
  293. ;
  294. ; extern OSStatus QueueSecondaryInterruptHandler(SecondaryInterruptHandler2 theHandler, ExceptionHandler exceptionHandler, void *p1, void *p2)
  295. ;
  296.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  297.         IMPORT_CFM_FUNCTION QueueSecondaryInterruptHandler
  298.     ENDIF
  299.  
  300.     ENDIF    ; TARGET_OS_MAC
  301. ;   Timers  
  302. ;
  303. ; extern OSStatus SetInterruptTimer(const AbsoluteTime *expirationTime, SecondaryInterruptHandler2 handler, void *p1, TimerID *theTimer)
  304. ;
  305.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  306.         IMPORT_CFM_FUNCTION SetInterruptTimer
  307.     ENDIF
  308.  
  309. ;
  310. ; extern OSStatus CancelTimer(TimerID theTimer, AbsoluteTime *timeRemaining)
  311. ;
  312.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  313.         IMPORT_CFM_FUNCTION CancelTimer
  314.     ENDIF
  315.  
  316.  
  317. ;   I/O related Operations  
  318. ;
  319. ; extern OSStatus PrepareMemoryForIO(IOPreparationTable *theIOPreparationTable)
  320. ;
  321.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  322.         IMPORT_CFM_FUNCTION PrepareMemoryForIO
  323.     ENDIF
  324.  
  325. ;
  326. ; extern OSStatus CheckpointIO(IOPreparationID theIOPreparation, IOCheckpointOptions options)
  327. ;
  328.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  329.         IMPORT_CFM_FUNCTION CheckpointIO
  330.     ENDIF
  331.  
  332.  
  333. ;   Memory Operations  
  334. ;
  335. ; extern OSStatus GetPageInformation(AddressSpaceID addressSpace, ConstLogicalAddress base, ItemCount requestedPages, PBVersion version, PageInformation *thePageInfo)
  336. ;
  337.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  338.         IMPORT_CFM_FUNCTION GetPageInformation
  339.     ENDIF
  340.  
  341. ;   Processor Cache Related  
  342. ;
  343. ; extern OSStatus SetProcessorCacheMode(AddressSpaceID addressSpace, ConstLogicalAddress base, ByteCount length, ProcessorCacheMode cacheMode)
  344. ;
  345.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  346.         IMPORT_CFM_FUNCTION SetProcessorCacheMode
  347.     ENDIF
  348.  
  349. ; ******************************************************************
  350. ; *
  351. ; *         Was in DriverSupport.h or DriverServices.h
  352. ; *
  353. ; *****************************************************************
  354.  
  355. ; typedef LogicalAddress *                DeviceLogicalAddressPtr
  356.  
  357.  
  358. durationMicrosecond                EQU        -1                    ; Microseconds are negative
  359. durationMillisecond                EQU        1                    ; Milliseconds are positive
  360. durationSecond                    EQU        1000                ; 1000 * durationMillisecond
  361. durationMinute                    EQU        60000                ; 60 * durationSecond,
  362. durationHour                    EQU        3600000                ; 60 * durationMinute,
  363. durationDay                        EQU        86400000            ; 24 * durationHour,
  364. durationNoWait                    EQU        0                    ; don't block
  365. durationForever                    EQU        $7FFFFFFF            ; no time limit
  366.  
  367. k8BitAccess                        EQU        0                    ; access as 8 bit
  368. k16BitAccess                    EQU        1                    ; access as 16 bit
  369. k32BitAccess                    EQU        2                    ; access as 32 bit
  370. Nanoseconds                RECORD 0
  371. f                         ds        UnsignedWide
  372. sizeof                     EQU *                    ; size:   $8 (8)
  373.                         ENDR
  374.  
  375.  
  376.  
  377. ;
  378. ; extern OSErr IOCommandIsComplete(IOCommandID theID, OSErr theResult)
  379. ;
  380.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  381.         IMPORT_CFM_FUNCTION IOCommandIsComplete
  382.     ENDIF
  383.  
  384. ;
  385. ; extern OSErr GetIOCommandInfo(IOCommandID theID, IOCommandContents *theContents, IOCommandCode *theCommand, IOCommandKind *theKind)
  386. ;
  387.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  388.         IMPORT_CFM_FUNCTION GetIOCommandInfo
  389.     ENDIF
  390.  
  391. ;
  392. ; extern void UpdateDeviceActivity(RegEntryID *deviceEntry)
  393. ;
  394.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  395.         IMPORT_CFM_FUNCTION UpdateDeviceActivity
  396.     ENDIF
  397.  
  398. ;
  399. ; extern void BlockCopy(const void *srcPtr, void *destPtr, Size byteCount)
  400. ;
  401.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  402.         IMPORT_CFM_FUNCTION BlockCopy
  403.     ENDIF
  404.  
  405. ;
  406. ; extern LogicalAddress PoolAllocateResident(ByteCount byteSize, Boolean clear)
  407. ;
  408.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  409.         IMPORT_CFM_FUNCTION PoolAllocateResident
  410.     ENDIF
  411.  
  412. ;
  413. ; extern OSStatus PoolDeallocate(LogicalAddress address)
  414. ;
  415.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  416.         IMPORT_CFM_FUNCTION PoolDeallocate
  417.     ENDIF
  418.  
  419. ;
  420. ; extern ByteCount GetLogicalPageSize(void )
  421. ;
  422.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  423.         IMPORT_CFM_FUNCTION GetLogicalPageSize
  424.     ENDIF
  425.  
  426. ;
  427. ; extern ByteCount GetDataCacheLineSize(void )
  428. ;
  429.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  430.         IMPORT_CFM_FUNCTION GetDataCacheLineSize
  431.     ENDIF
  432.  
  433. ;
  434. ; extern OSStatus FlushProcessorCache(AddressSpaceID spaceID, LogicalAddress base, ByteCount length)
  435. ;
  436.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  437.         IMPORT_CFM_FUNCTION FlushProcessorCache
  438.     ENDIF
  439.  
  440. ;
  441. ; extern LogicalAddress MemAllocatePhysicallyContiguous(ByteCount byteSize, Boolean clear)
  442. ;
  443.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  444.         IMPORT_CFM_FUNCTION MemAllocatePhysicallyContiguous
  445.     ENDIF
  446.  
  447. ;
  448. ; extern OSStatus MemDeallocatePhysicallyContiguous(LogicalAddress address)
  449. ;
  450.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  451.         IMPORT_CFM_FUNCTION MemDeallocatePhysicallyContiguous
  452.     ENDIF
  453.  
  454.  
  455. ;
  456. ; extern AbsoluteTime UpTime(void )
  457. ;
  458.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  459.         IMPORT_CFM_FUNCTION UpTime
  460.     ENDIF
  461.  
  462. ;
  463. ; extern void GetTimeBaseInfo(UInt32 *minAbsoluteTimeDelta, UInt32 *theAbsoluteTimeToNanosecondNumerator, UInt32 *theAbsoluteTimeToNanosecondDenominator, UInt32 *theProcessorToAbsoluteTimeNumerator, UInt32 *theProcessorToAbsoluteTimeDenominator)
  464. ;
  465.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  466.         IMPORT_CFM_FUNCTION GetTimeBaseInfo
  467.     ENDIF
  468.  
  469.  
  470. ;
  471. ; extern Nanoseconds AbsoluteToNanoseconds(AbsoluteTime absoluteTime)
  472. ;
  473.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  474.         IMPORT_CFM_FUNCTION AbsoluteToNanoseconds
  475.     ENDIF
  476.  
  477. ;
  478. ; extern Duration AbsoluteToDuration(AbsoluteTime absoluteTime)
  479. ;
  480.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  481.         IMPORT_CFM_FUNCTION AbsoluteToDuration
  482.     ENDIF
  483.  
  484. ;
  485. ; extern AbsoluteTime NanosecondsToAbsolute(Nanoseconds nanoseconds)
  486. ;
  487.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  488.         IMPORT_CFM_FUNCTION NanosecondsToAbsolute
  489.     ENDIF
  490.  
  491. ;
  492. ; extern AbsoluteTime DurationToAbsolute(Duration duration)
  493. ;
  494.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  495.         IMPORT_CFM_FUNCTION DurationToAbsolute
  496.     ENDIF
  497.  
  498. ;
  499. ; extern AbsoluteTime AddAbsoluteToAbsolute(AbsoluteTime absoluteTime1, AbsoluteTime absoluteTime2)
  500. ;
  501.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  502.         IMPORT_CFM_FUNCTION AddAbsoluteToAbsolute
  503.     ENDIF
  504.  
  505. ;
  506. ; extern AbsoluteTime SubAbsoluteFromAbsolute(AbsoluteTime leftAbsoluteTime, AbsoluteTime rightAbsoluteTime)
  507. ;
  508.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  509.         IMPORT_CFM_FUNCTION SubAbsoluteFromAbsolute
  510.     ENDIF
  511.  
  512. ;
  513. ; extern AbsoluteTime AddNanosecondsToAbsolute(Nanoseconds nanoseconds, AbsoluteTime absoluteTime)
  514. ;
  515.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  516.         IMPORT_CFM_FUNCTION AddNanosecondsToAbsolute
  517.     ENDIF
  518.  
  519. ;
  520. ; extern AbsoluteTime AddDurationToAbsolute(Duration duration, AbsoluteTime absoluteTime)
  521. ;
  522.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  523.         IMPORT_CFM_FUNCTION AddDurationToAbsolute
  524.     ENDIF
  525.  
  526. ;
  527. ; extern AbsoluteTime SubNanosecondsFromAbsolute(Nanoseconds nanoseconds, AbsoluteTime absoluteTime)
  528. ;
  529.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  530.         IMPORT_CFM_FUNCTION SubNanosecondsFromAbsolute
  531.     ENDIF
  532.  
  533. ;
  534. ; extern AbsoluteTime SubDurationFromAbsolute(Duration duration, AbsoluteTime absoluteTime)
  535. ;
  536.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  537.         IMPORT_CFM_FUNCTION SubDurationFromAbsolute
  538.     ENDIF
  539.  
  540. ;
  541. ; extern Nanoseconds AbsoluteDeltaToNanoseconds(AbsoluteTime leftAbsoluteTime, AbsoluteTime rightAbsoluteTime)
  542. ;
  543.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  544.         IMPORT_CFM_FUNCTION AbsoluteDeltaToNanoseconds
  545.     ENDIF
  546.  
  547. ;
  548. ; extern Duration AbsoluteDeltaToDuration(AbsoluteTime leftAbsoluteTime, AbsoluteTime rightAbsoluteTime)
  549. ;
  550.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  551.         IMPORT_CFM_FUNCTION AbsoluteDeltaToDuration
  552.     ENDIF
  553.  
  554. ;
  555. ; extern Nanoseconds DurationToNanoseconds(Duration theDuration)
  556. ;
  557.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  558.         IMPORT_CFM_FUNCTION DurationToNanoseconds
  559.     ENDIF
  560.  
  561. ;
  562. ; extern Duration NanosecondsToDuration(Nanoseconds theNanoseconds)
  563. ;
  564.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  565.         IMPORT_CFM_FUNCTION NanosecondsToDuration
  566.     ENDIF
  567.  
  568.  
  569. ;
  570. ; extern OSErr PBQueueInit(QHdrPtr qHeader)
  571. ;
  572.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  573.         IMPORT_CFM_FUNCTION PBQueueInit
  574.     ENDIF
  575.  
  576. ;
  577. ; extern OSErr PBQueueCreate(QHdrPtr *qHeader)
  578. ;
  579.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  580.         IMPORT_CFM_FUNCTION PBQueueCreate
  581.     ENDIF
  582.  
  583. ;
  584. ; extern OSErr PBQueueDelete(QHdrPtr qHeader)
  585. ;
  586.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  587.         IMPORT_CFM_FUNCTION PBQueueDelete
  588.     ENDIF
  589.  
  590. ;
  591. ; extern void PBEnqueue(QElemPtr qElement, QHdrPtr qHeader)
  592. ;
  593.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  594.         IMPORT_CFM_FUNCTION PBEnqueue
  595.     ENDIF
  596.  
  597. ;
  598. ; extern OSErr PBEnqueueLast(QElemPtr qElement, QHdrPtr qHeader)
  599. ;
  600.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  601.         IMPORT_CFM_FUNCTION PBEnqueueLast
  602.     ENDIF
  603.  
  604. ;
  605. ; extern OSErr PBDequeue(QElemPtr qElement, QHdrPtr qHeader)
  606. ;
  607.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  608.         IMPORT_CFM_FUNCTION PBDequeue
  609.     ENDIF
  610.  
  611. ;
  612. ; extern OSErr PBDequeueFirst(QHdrPtr qHeader, QElemPtr *theFirstqElem)
  613. ;
  614.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  615.         IMPORT_CFM_FUNCTION PBDequeueFirst
  616.     ENDIF
  617.  
  618. ;
  619. ; extern OSErr PBDequeueLast(QHdrPtr qHeader, QElemPtr *theLastqElem)
  620. ;
  621.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  622.         IMPORT_CFM_FUNCTION PBDequeueLast
  623.     ENDIF
  624.  
  625. ;
  626. ; extern char *CStrCopy(char *dst, const char *src)
  627. ;
  628.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  629.         IMPORT_CFM_FUNCTION CStrCopy
  630.     ENDIF
  631.  
  632. ;
  633. ; extern StringPtr PStrCopy(StringPtr dst, ConstStr255Param src)
  634. ;
  635.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  636.         IMPORT_CFM_FUNCTION PStrCopy
  637.     ENDIF
  638.  
  639. ;
  640. ; extern char *CStrNCopy(char *dst, const char *src, UInt32 max)
  641. ;
  642.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  643.         IMPORT_CFM_FUNCTION CStrNCopy
  644.     ENDIF
  645.  
  646. ;
  647. ; extern StringPtr PStrNCopy(StringPtr dst, ConstStr255Param src, UInt32 max)
  648. ;
  649.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  650.         IMPORT_CFM_FUNCTION PStrNCopy
  651.     ENDIF
  652.  
  653. ;
  654. ; extern char *CStrCat(char *dst, const char *src)
  655. ;
  656.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  657.         IMPORT_CFM_FUNCTION CStrCat
  658.     ENDIF
  659.  
  660. ;
  661. ; extern StringPtr PStrCat(StringPtr dst, ConstStr255Param src)
  662. ;
  663.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  664.         IMPORT_CFM_FUNCTION PStrCat
  665.     ENDIF
  666.  
  667. ;
  668. ; extern char *CStrNCat(char *dst, const char *src, UInt32 max)
  669. ;
  670.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  671.         IMPORT_CFM_FUNCTION CStrNCat
  672.     ENDIF
  673.  
  674. ;
  675. ; extern StringPtr PStrNCat(StringPtr dst, ConstStr255Param src, UInt32 max)
  676. ;
  677.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  678.         IMPORT_CFM_FUNCTION PStrNCat
  679.     ENDIF
  680.  
  681. ;
  682. ; extern void PStrToCStr(char *dst, ConstStr255Param src)
  683. ;
  684.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  685.         IMPORT_CFM_FUNCTION PStrToCStr
  686.     ENDIF
  687.  
  688. ;
  689. ; extern void CStrToPStr(Str255 dst, const char *src)
  690. ;
  691.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  692.         IMPORT_CFM_FUNCTION CStrToPStr
  693.     ENDIF
  694.  
  695. ;
  696. ; extern SInt16 CStrCmp(const char *s1, const char *s2)
  697. ;
  698.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  699.         IMPORT_CFM_FUNCTION CStrCmp
  700.     ENDIF
  701.  
  702. ;
  703. ; extern SInt16 PStrCmp(ConstStr255Param str1, ConstStr255Param str2)
  704. ;
  705.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  706.         IMPORT_CFM_FUNCTION PStrCmp
  707.     ENDIF
  708.  
  709. ;
  710. ; extern SInt16 CStrNCmp(const char *s1, const char *s2, UInt32 max)
  711. ;
  712.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  713.         IMPORT_CFM_FUNCTION CStrNCmp
  714.     ENDIF
  715.  
  716. ;
  717. ; extern SInt16 PStrNCmp(ConstStr255Param str1, ConstStr255Param str2, UInt32 max)
  718. ;
  719.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  720.         IMPORT_CFM_FUNCTION PStrNCmp
  721.     ENDIF
  722.  
  723. ;
  724. ; extern UInt32 CStrLen(const char *src)
  725. ;
  726.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  727.         IMPORT_CFM_FUNCTION CStrLen
  728.     ENDIF
  729.  
  730. ;
  731. ; extern UInt32 PStrLen(ConstStr255Param src)
  732. ;
  733.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  734.         IMPORT_CFM_FUNCTION PStrLen
  735.     ENDIF
  736.  
  737. ;
  738. ; extern OSStatus DeviceProbe(void *theSrc, void *theDest, UInt32 AccessType)
  739. ;
  740.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  741.         IMPORT_CFM_FUNCTION DeviceProbe
  742.     ENDIF
  743.  
  744. ;
  745. ; extern OSStatus DelayForHardware(AbsoluteTime absoluteTime)
  746. ;
  747.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  748.         IMPORT_CFM_FUNCTION DelayForHardware
  749.     ENDIF
  750.  
  751.  
  752.  
  753. ; ******************************************************************
  754. ; *
  755. ; *         Was in Interrupts.h 
  756. ; *
  757. ; *****************************************************************
  758.  
  759. ;   Interrupt types  
  760.  
  761.  
  762. ; typedef long                             InterruptMemberNumber
  763.  
  764. InterruptSetMember        RECORD 0
  765. setID                     ds.l    1                ; offset: $0 (0)
  766. member                     ds.l    1                ; offset: $4 (4)
  767. sizeof                     EQU *                    ; size:   $8 (8)
  768.                         ENDR
  769.  
  770. kISTChipInterruptSource            EQU        0
  771. kISTOutputDMAInterruptSource    EQU        1
  772. kISTInputDMAInterruptSource        EQU        2
  773. kISTPropertyMemberCount            EQU        3
  774. ISTProperty                RECORD 0
  775. elements                 ds.b    3 * InterruptSetMember.sizeof
  776. sizeof                     EQU *                    ; size:   $18 (24)
  777.                         ENDR
  778.  
  779.  
  780. ; typedef long                             InterruptReturnValue
  781.  
  782.  
  783. kFirstMemberNumber                EQU        1
  784. kIsrIsComplete                    EQU        0
  785. kIsrIsNotComplete                EQU        -1
  786. kMemberNumberParent                EQU        -2
  787. ; typedef Boolean                         InterruptSourceState
  788.  
  789.  
  790. kSourceWasEnabled                EQU        1
  791. kSourceWasDisabled                EQU        0
  792.  
  793.  
  794. kReturnToParentWhenComplete        EQU        $00000001
  795. kReturnToParentWhenNotComplete    EQU        $00000002
  796. ; typedef OptionBits                     InterruptSetOptions
  797.  
  798. ;   Interrupt Services  
  799. ;
  800. ; extern OSStatus CreateInterruptSet(InterruptSetID parentSet, InterruptMemberNumber parentMember, InterruptMemberNumber setSize, InterruptSetID *setID, InterruptSetOptions options)
  801. ;
  802.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  803.         IMPORT_CFM_FUNCTION CreateInterruptSet
  804.     ENDIF
  805.  
  806.  
  807. ;
  808. ; extern OSStatus InstallInterruptFunctions(InterruptSetID setID, InterruptMemberNumber member, void *refCon, InterruptHandler handlerFunction, InterruptEnabler enableFunction, InterruptDisabler disableFunction)
  809. ;
  810.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  811.         IMPORT_CFM_FUNCTION InstallInterruptFunctions
  812.     ENDIF
  813.  
  814.  
  815. ;
  816. ; extern OSStatus GetInterruptFunctions(InterruptSetID setID, InterruptMemberNumber member, void **refCon, InterruptHandler *handlerFunction, InterruptEnabler *enableFunction, InterruptDisabler *disableFunction)
  817. ;
  818.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  819.         IMPORT_CFM_FUNCTION GetInterruptFunctions
  820.     ENDIF
  821.  
  822. ;
  823. ; extern OSStatus ChangeInterruptSetOptions(InterruptSetID setID, InterruptSetOptions options)
  824. ;
  825.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  826.         IMPORT_CFM_FUNCTION ChangeInterruptSetOptions
  827.     ENDIF
  828.  
  829. ;
  830. ; extern OSStatus GetInterruptSetOptions(InterruptSetID setID, InterruptSetOptions *options)
  831. ;
  832.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  833.         IMPORT_CFM_FUNCTION GetInterruptSetOptions
  834.     ENDIF
  835.  
  836.  
  837.  
  838.     ENDIF ; __DRIVERSERVICES__ 
  839.  
  840.